﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;
public partial class HomePage_GoodsTrend : System.Web.UI.Page
{
    public string GoodsTrend()
    {
        int i = 0;
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        Db db = new Db();
        DbPage dbPage = new DbPage(db);
        dbPage.Table = "GoodsTrend";
        dbPage.Key = "TrendID";
        dbPage.Where = "";
        dbPage.SelectField = "TrendID,Title,AddDate  "; ;
        dbPage.PageIndex = SysFun.ToInt(Request["CurrentlyPageIndex"]);
        dbPage.PageSize = 24;
        dbPage.OrderBy = "TrendID";
        dbPage.OrderByIsDesc = true;
        System.Data.IDataReader dr = dbPage.ExecuteReader();
        sb.Append("<ul>");
        while (dr.Read())
        {
            i++;
            sb.Append("<li>");
            sb.Append("<div style='float:left'><img src='../images/gif-0057.gif' >&nbsp;<a href='ContentShow.aspx?pid=" + MsgBox.JiaMiobj_Encrypt(dr["TrendID"].ToString()) + "&&tid=cgdt' target=_blank>" + dr["Title"].ToString() + "</a>");
            if (System.DateTime.Now <= Convert.ToDateTime(dr["AddDate"].ToString()).AddDays(2))
                sb.Append("&nbsp;<img src='../images/new.gif' width='28' height=11></div>");
            else
                sb.Append("</div>");
            sb.Append("<div class=\"TT\">[" + Convert.ToDateTime(dr["AddDate"].ToString()).ToString("yy-MM-dd") + "]</div>");
            sb.Append("</li>");
        }
        sb.Append("</ul>");
        dr.Close();
        dr.Dispose();
        dbPage.Db.Close();
        db.Close();

        this.DbPageFlip1.DbPage = dbPage;

        return sb.ToString();
    }
}

